package com.seed.launcher.listener.wifi;

import android.content.Context;

import androidx.annotation.Keep;

import com.seed.launcher.listener.Registerable;

/**
 * @author xct
 * create on: 2022/8/31 18:18
 */
@Keep
public class WifiListener implements Registerable {

    private WifiTracker mWifiTracker;
    @Keep
    public WifiListener(Context context, OnWifiChangedListener listener) {
        mWifiTracker = new WifiTracker(context,listener);
    }
    @Keep
    @Override
    public void register() {
        if (mWifiTracker != null) {
            mWifiTracker.onStart();
        }
    }

    @Keep
    @Override
    public void unregister() {
        if (mWifiTracker != null) {
            mWifiTracker.onStop();
            mWifiTracker.onDestroy();
        }
    }
}
